$("#table-name").text("table-name: "+getQ().table)
function getL(data){
$.ajax({
	"url":"/table/",
	"error":errorAjax,
	"beforeSend":start_load_pic,
	"complete":stop_load_pic,
	"dataType":"jsonp",
	"data":{"table":getQ().table,"start_date":data.start_date,"end_date":data.end_date},
	"success":function(data){
		$("#tab>tr").remove()
		if(responseCheck(data)){
			var thead=document.getElementById("thead")
			for(var i=0; i<data.title.length;i++){
				var th=document.createElement("th")
				th.style.minWidth="150px"
				th.style.textAlign="center"
				th.textContent=data.title[i]
				thead.appendChild(th)
				
			}
			var tab=document.getElementById("tab")
			for(var i=0;i<data.content.length;i++){
				var tr=document.createElement("tr")
				for (var y=0;y<data.content[i].length;y++){
					var td=document.createElement("td")
					td.style.textAlign="center"
					td.style.verticalAlign="middle"
					td.textContent=data.content[i][y]
					tr.appendChild(td)
				}
				tab.appendChild(tr)
				
			}
			
		}
		
	}
})
}


document.getElementById("search").onclick=function(){
	var data={}
	data.start_date=$("#start_date").val()
	data.end_date=$("#end_date").val()
	if(data.start_date==="" || data.end_date===""){
		showErrorInfo("请选择日期进行查询！")
		return false;
	}
	getL(data)
}
getL({})
